import Vue from "vue";
import Vuex from "vuex";
import state from "./state";
import getters from "./getters";
import mutations from "src/store/mutations";
import actions from "./actions";
import modules from "./modules";
// import example from './module-example'
import createPersistedState from "vuex-persistedstate";

Vue.use(Vuex);

/*
 * If not building with SSR mode, you can
 * directly export the Store instantiation;
 *
 * The function below can be async too; either use
 * async/await or return a Promise which resolves
 * with the Store instance.
 */

// export default function (/* { ssrContext } */) {
const store = new Vuex.Store({
  state,
  getters,
  mutations,
  actions,
  modules,
  // enable strict mode (adds overhead!)
  // for dev mode only
  strict: process.env.DEBUGGING,
  plugins: [createPersistedState()]
});

export default store;
// }
